<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>变量交换</title>
</head>
<body>
    <script>
    // Swift the values by a temp xxx.
    var num1 = 10;
    var num2 = 20;
    var temp;
    temp = num1;
    num1 = num2;
    num2 = temp;

    // Add and munites

    var num3 = 10;
    var num4 = 20;
    num3 += num4;
    num4 = num3 - num4;
    num3 = num3 - num4;

    console.log(num1, num2, num3, num4);

    
    </script>
</body>
</html>